<?php include("../config.php"); ?>

<html>
<head>
<title><?php echo($name); ?></title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />

</head>
<body>
<h1><?php echo($name); ?></h1>
<?php
if(empty($_SESSION['login'])) {
echo("<h3>Connectez-vous pour voir cette page!");
}

else {
?>
<div style="background-color: blue; color: white;"><h3>Mes URLs</h3></div>

<table border="1">
<tr>
<th>Identifiant</th>
<th>Url pointée</th>
<th>Actions</th>
</tr>


<?php
dbconnect();
$req = mysql_query("SELECT * FROM ".$prefix."url WHERE `owner` = '".$_SESSION['login']."'");

while($data = mysql_fetch_array($req)) {
echo("<tr><td>".$data['key']."</td>");
echo("<td>".$data['url']."</td>");
?>
<td><a href="edit.php?id=<?php echo($data['key']); ?>">Editer</a>   <a href=" ../del.php?id=<?php echo($data['delkey']); ?>">Supprimer</a></td>
</tr>
<?php
}
?>

</table>
<?php
}
?>

</body>
</html>

